package cn.me.alphamq.broker.config;

import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

/**
 * 通用的线程池配置类
 *
 * @author f
 */
public class CommonThreadPoolConfig {

    // 用于异步刷盘 topic 配置信息
    public static ThreadPoolExecutor refreshTopicInfoExecutor = new ThreadPoolExecutor(
            1, 1, 30, TimeUnit.SECONDS, new ArrayBlockingQueue<>(10), r -> new Thread(r, "refresh-topic-info-config")
    );

    // 用于异步刷盘 offset 信息
    public static ThreadPoolExecutor refreshOffsetInfoExecutor = new ThreadPoolExecutor(
            1, 1, 30, TimeUnit.SECONDS, new ArrayBlockingQueue<>(10), r -> new Thread(r, "refresh-offset-info-config")
    );

}
